(******************************************************************************)
(* Delphi Free Stuff Include File.  This file is used for all my components   *)
(* to create some standard defines.  This will help reduce headaches when new *)
(* versions of Delphi and C++Builder are released, among other things.        *)
(******************************************************************************)
(******************************************************************************)
(* Usage:   Add the following line to the top of your unit file:              *)
(*   {$I FlatStyle.INC}                                                       *)
(******************************************************************************)
(*                                                                            *)
(* Complete Boolean Evaluation compiler directive is turned off by including  *)
(*   this file.                                                               *)
(* The $ObjExportAll directive is turned on if compiling with C++Builder 3 or *)
(*   higher.  This is required for Delphi components built in Builder with    *)
(*   run-time packages.                                                       *)
(*                                                                            *)
(* Here is a brief explanation of what each of the defines mean:              *)
(* DELPHI_FREE_STUFF    : Always defined when DFS.INC is included             *)
(* DFS_WIN16            : Compilation target is 16-bit Windows                *)
(* DFS_WIN32            : Compilation target is 32-bit Windows                *)
(* DFS_USEDEFSHLOBJ     : The SHLOBJ.PAS version contains no none errors.     *)
(*                        Delphi 2.0x and C++Builder 1.0x shipped with a      *)
(*                        version of SHLOBJ.PAS that had many nasty errors.   *)
(*                        See my web site in the Hints section for how to fix *)
(* DFS_NO_COM_CLEANUP   : The version of the compiler being used does not     *)
(*                        require COM objects to be released; it is done      *)
(*                        automatically when they go "out of scope".          *)
(* DFS_COMPILER_1       : Delphi 1.0 is the compiler.  Note that C++B 1.0     *)
(*                        does NOT cause this to be defined.  It is really    *)
(*                        the 2.0 compiler.                                   *)
(* DFS_COMPILER_1_UP    : Delphi 1.0x or higher, or C++B 1.0x or higher is    *)
(*                        the compiler.                                       *)
(* DFS_COMPILER_2       : Delphi 2.0x or C++B 1.0x is the compiler.           *)
(* DFS_COMPILER_2_UP    : Delphi 2.0x or higher, or C++B 1.0x or higher is    *)
(*                        the compiler.                                       *)
(* DFS_COMPILER_3       : Delphi 3.0x or C++B 3.0x is the compiler.           *)
(* DFS_COMPILER_3_UP    : Delphi 3.0x or higher, or C++B 3.0x or higher is    *)
(*                        the compiler.                                       *)
(* DFS_COMPILER_4       : Delphi 4.0x or C++B 4.0x is the compiler.           *)
(* DFS_COMPILER_4_UP    : Delphi 4.0x or higher, or C++B 4.0x or higher is    *)
(*                        the compiler.                                       *)
(* DFS_COMPILER_5       : Delphi 5.0x or C++B 5.0x is the compiler.           *)
(* DFS_COMPILER_5_UP    : Delphi 5.0x or higher, or C++B 5.0x or higher is    *)
(*                        the compiler.                                       *)
(* DFS_COMPILER_6       : Delphi 6.0x or C++B 6.0x is the compiler.           *)
(* DFS_COMPILER_6_UP    : Delphi 6.0x or higher, or C++B 6.0x or higher is    *)
(*                        the compiler.                                       *)
(* DFS_COMPILER_2007    : Delphi 2007 or C++B 2007 is the compiler.           *)
(* DFS_COMPILER_2007_UP : Delphi 2007 or higher, or C++B 2007 or higher is    *)
(*                        the compiler.                                       *)
(* DFS_UNKNOWN_COMPILER : No sense could be made of the compiliation          *)
(*                        environment.                                        *)
(* DFS_CPPB             : Any version of C++B is being used.                  *)
(* DFS_CPPB_1           : C++B v1.0x is being used.                           *)
(* DFS_CPPB_3           : C++B v3.0x is being used.                           *)
(* DFS_CPPB_3_UP        : C++B v3.0x or higher is being used.                 *)
(* DFS_CPPB_4           : C++B v4.0x is being used.                           *)
(* DFS_CPPB_4_UP        : C++B v4.0x or higher is being used.                 *)
(* DFS_DELPHI           : Any version of Delphi is being used.                *)
(* DFS_DELPHI_1         : Delphi v1.0x is being used.                         *)
(* DFS_DELPHI_2         : Delphi v2.0x is being used.                         *)
(* DFS_DELPHI_2_UP      : Delphi v2.0x or higher is being used.               *)
(* DFS_DELPHI_3         : Delphi v3.0x is being used.                         *)
(* DFS_DELPHI_3_UP      : Delphi v3.0x or higher is being used.               *)
(* DFS_DELPHI_4         : Delphi v4.0x is being used.                         *)
(* DFS_DELPHI_4_UP      : Delphi v4.0x or higher is being used.               *)
(* DFS_DELPHI_5         : Delphi v5.0x is being used.                         *)
(* DFS_DELPHI_5_UP      : Delphi v5.0x or higher is being used.               *)
(* DFS_DELPHI_6         : Delphi v6.0x is being used.                         *)
(* DFS_DELPHI_6_UP      : Delphi v6.0x or higher is being used.               *)
(* DFS_DELPHI_7         : Delphi v7.0x is being used.                         *)
(* DFS_DELPHI_7_UP      : Delphi v7.0x or higher is being used.               *)
(* DFS_DELPHI_8         : Delphi v8.0x is being used.                         *)
(* DFS_DELPHI_8_UP      : Delphi v8.0x or higher is being used.               *)
(* DFS_DELPHI_2005      : Delphi v2005 is being used.                         *)
(* DFS_DELPHI_2005_UP   : Delphi v2005 or higher is being used.               *)
(* DFS_DELPHI_2006      : Delphi v2006 is being used.                         *)
(* DFS_DELPHI_2006_UP   : Delphi v2006 or higher is being used.               *)
(* DFS_DELPHI_2007      : Delphi v2007 is being used.                         *)
(* DFS_DELPHI_2007_UP   : Delphi v2007 or higher is being used.               *)
(******************************************************************************)
{ All DFS components rely on complete boolean eval compiler directive set off. }
{$B-}
{$X+}
{$H+} 

{$DEFINE DELPHI_FREE_STUFF}

{$IFDEF WIN32}
  {$DEFINE DFS_WIN32}
{$ELSE}
  {$DEFINE DFS_WIN16}
{$ENDIF}

{ Delphi 2007 and C++ Builder 2007 } 
{$IFDEF VER185}
  {$DEFINE DFS_COMPILER_6}
  {$DEFINE DFS_COMPILER_2007}
  {$DEFINE DELPHI_4_UP}
  {$DEFINE DELPHI_5_UP}
  {$DEFINE DELPHI_6_UP}
  {$DEFINE DELPHI_7_UP}
  {$DEFINE DELPHI_8_UP}
  {$DEFINE DELPHI_2005_UP}
  {$DEFINE DELPHI_2006_UP}
  {$DEFINE DELPHI_2007_UP}
  {$DEFINE DELPHI_2007}
  {$IFDEF BCBNOTDELPHI}
     {$ObjExportAll On}
  {$ENDIF}
  {$WARN UNSAFE_CAST OFF}
  {$WARN UNSAFE_CODE OFF}
  {$WARN UNSAFE_TYPE OFF}
  {$WARN SYMBOL_PLATFORM OFF}
  {$WARN UNIT_PLATFORM OFF}
  {$WARN SYMBOL_DEPRECATED OFF}
  {$WARN UNIT_DEPRECATED OFF}
{$ENDIF}

{ Borland Developer Studio 2006 }
{$IFDEF VER180}         
  {$DEFINE DFS_COMPILER_6}
  {$DEFINE DELPHI_4_UP}
  {$DEFINE DELPHI_5_UP}
  {$DEFINE DELPHI_6_UP}
  {$DEFINE DELPHI_7_UP}
  {$DEFINE DELPHI_8_UP}
  {$DEFINE DELPHI_2005_UP}
  {$DEFINE DELPHI_2006_UP}
  {$DEFINE DELPHI_2006}
  {$IFDEF BCBNOTDELPHI}
     {$ObjExportAll On}
  {$ENDIF}
  {$WARN UNSAFE_CAST OFF}
  {$WARN UNSAFE_CODE OFF}
  {$WARN UNSAFE_TYPE OFF}
  {$WARN SYMBOL_PLATFORM OFF}
  {$WARN UNIT_PLATFORM OFF}
  {$WARN SYMBOL_DEPRECATED OFF}
  {$WARN UNIT_DEPRECATED OFF}
{$ENDIF}
{ Borland Delphi 2005 }
{$IFDEF VER170}         
  {$DEFINE DFS_COMPILER_6}
  {$DEFINE DELPHI_4_UP}
  {$DEFINE DELPHI_5_UP}
  {$DEFINE DELPHI_6_UP}
  {$DEFINE DELPHI_7_UP}
  {$DEFINE DELPHI_7_UP}
  {$DEFINE DELPHI_8_UP}
  {$DEFINE DELPHI_2005_UP}
  {$DEFINE DELPHI_2005}
  {$IFDEF BCBNOTDELPHI}
     {$ObjExportAll On}
  {$ENDIF}
  {$WARN UNSAFE_CAST OFF}
  {$WARN UNSAFE_CODE OFF}
  {$WARN UNSAFE_TYPE OFF}
  {$WARN SYMBOL_PLATFORM OFF}
  {$WARN UNIT_PLATFORM OFF}
  {$WARN SYMBOL_DEPRECATED OFF}
  {$WARN UNIT_DEPRECATED OFF}
{$ENDIF}
{ Borland Delphi 8.0 }
{$IFDEF VER160}            
  {$DEFINE DFS_COMPILER_6}
  {$DEFINE DELPHI_4_UP}
  {$DEFINE DELPHI_5_UP}
  {$DEFINE DELPHI_6_UP}
  {$DEFINE DELPHI_7_UP}
  {$DEFINE DELPHI_8_UP}
  {$DEFINE DELPHI_8}
  {$IFDEF BCBNOTDELPHI}
     {$ObjExportAll On}
  {$ENDIF}
  {$WARN UNSAFE_CAST OFF}
  {$WARN UNSAFE_CODE OFF}
  {$WARN UNSAFE_TYPE OFF}
  {$WARN SYMBOL_PLATFORM OFF}
  {$WARN UNIT_PLATFORM OFF}
  {$WARN SYMBOL_DEPRECATED OFF}
  {$WARN UNIT_DEPRECATED OFF}
{$ENDIF}
{ Delphi 7 and C++ Builder 6 } 
{$IFDEF VER150}      
  {$DEFINE DFS_COMPILER_6}
  {$DEFINE DELPHI_4_UP}
  {$DEFINE DELPHI_5_UP}
  {$DEFINE DELPHI_6_UP}
  {$DEFINE DELPHI_7_UP}
  {$DEFINE DELPHI_7}
  {$IFDEF BCBNOTDELPHI}
     {$ObjExportAll On}
  {$ENDIF}  
  {$WARN UNSAFE_CAST OFF}
  {$WARN UNSAFE_CODE OFF}
  {$WARN UNSAFE_TYPE OFF}
  {$WARN SYMBOL_PLATFORM OFF}
  {$WARN UNIT_PLATFORM OFF}
  {$WARN SYMBOL_DEPRECATED OFF}
  {$WARN UNIT_DEPRECATED OFF}
{$ENDIF}
{ Delphi 6 and C++ Builder 6 }
{$IFDEF VER140}     
  {$DEFINE DFS_COMPILER_6}
  {$DEFINE DELPHI_4_UP}
  {$DEFINE DELPHI_5_UP}
  {$DEFINE DELPHI_6_UP}
  {$DEFINE DELPHI_6}
  {$IFDEF BCBNOTDELPHI}
     {$ObjExportAll On}
  {$ENDIF}
  {$WARN UNSAFE_CAST OFF}
  {$WARN UNSAFE_CODE OFF}
  {$WARN UNSAFE_TYPE OFF}
  {$WARN SYMBOL_PLATFORM OFF}
  {$WARN UNIT_PLATFORM OFF}
  {$WARN SYMBOL_DEPRECATED OFF}
  {$WARN UNIT_DEPRECATED OFF}
{$ENDIF}
{ Delphi 5 and C++ Builder 5 }
{$IFDEF VER130}
  {$DEFINE DFS_COMPILER_5}
  {$DEFINE DFS_DELPHI}
  {$DEFINE DFS_USEDEFSHLOBJ} { Only D3+ and C++B 3+ have no errors in SHLOBJ }
  {$DEFINE DELPHI_4_UP}
  {$DEFINE DELPHI_5_UP}
  {$DEFINE DELPHI_5}
  {$IFDEF BCBNOTDELPHI}
    {$ObjExportAll On}
  {$ENDIF}
{$ENDIF}
{ Delphi 4 and C++ Builder 4 }
{$IFDEF VER125}
  {$DEFINE DFS_COMPILER_4}
  {$DEFINE DFS_CPPB}
  {$DEFINE DFS_CPPB_4}
  {$DEFINE DFS_USEDEFSHLOBJ} { Only D3+ and C++B 3+ have no errors in SHLOBJ }
  {$DEFINE DELPHI_4_UP}
  {$DEFINE DELPHI_4}
  {$ObjExportAll On}
{$ENDIF}
{ Delphi 4 and C++ Builder 4 }
{$IFDEF VER120}
  {$DEFINE DFS_COMPILER_4}
  {$DEFINE DFS_DELPHI}
  {$DEFINE DFS_DELPHI_4}
  {$DEFINE DFS_USEDEFSHLOBJ} { Only D3+ and C++B 3+ have no errors in SHLOBJ }
  {$DEFINE DELPHI_4_UP}
  {$DEFINE DELPHI_4}
{$ENDIF}
{ Delphi 3 and C++ Builder 3 }
{$IFDEF VER110}
  {$DEFINE DFS_COMPILER_3}
  {$DEFINE DFS_CPPB}
  {$DEFINE DFS_CPPB_3}
  {$DEFINE DFS_USEDEFSHLOBJ} { Only D3+ and C++B 3+ have no errors in SHLOBJ }
  {$ObjExportAll On}
{$ENDIF}
{ Delphi 3 and C++ Builder 3 }
{$IFDEF VER100}
  {$DEFINE DFS_COMPILER_3}
  {$DEFINE DFS_DELPHI}
  {$DEFINE DFS_DELPHI_3}
  {$DEFINE DFS_USEDEFSHLOBJ} { Only D3+ and C++B 3+ have no errors in SHLOBJ }
{$ENDIF}

{$IFDEF VER93}
  {$DEFINE DFS_COMPILER_2}  { C++B v1 compiler is really v2 }
  {$DEFINE DFS_CPPB}
  {$DEFINE DFS_CPPB_1}
  {.$DEFINE DFS_USEDEFSHLOBJ} { C++B 1 has the correct SHLOBJ.H, but
                                SHLOBJ.PAS has errors so this isn't defined }
{$ENDIF}

{$IFDEF VER90}
  {$DEFINE DFS_COMPILER_2}
  {$DEFINE DFS_DELPHI}
  {$DEFINE DFS_DELPHI_2}
{$ENDIF}

{$IFDEF VER80}
  {$DEFINE DFS_COMPILER_1}
  {$DEFINE DFS_DELPHI}
  {$DEFINE DFS_DELPHI_1}
{$ENDIF}

{$IFNDEF DFS_CPPB}
  {$IFNDEF DFS_DELPHI}
    { Don't know what the hell it is.  Could be new version, or could be old BP. }
    {$DEFINE DFS_UNKNOWN_COMPILER}
  {$ENDIF}
{$ENDIF}

{$IFDEF DFS_CPPB_3}
  {$DEFINE DFS_CPPB_3_UP}
{$ENDIF}

{$IFDEF DFS_CPPB_4}
  {$DEFINE DFS_CPPB_3_UP}
  {$DEFINE DFS_CPPB_4_UP}
{$ENDIF}

{$IFDEF DFS_CPPB_3_UP}
  // C++Builder requires this if you use Delphi components in run-time packages.
  {$ObjExportAll On}
{$ENDIF}

{$IFDEF DFS_COMPILER_1}
  {$DEFINE DFS_COMPILER_1_UP}
{$ENDIF}

{$IFDEF DFS_COMPILER_2}
  {$DEFINE DFS_COMPILER_1_UP}
  {$DEFINE DFS_COMPILER_2_UP}
{$ENDIF}

{$IFDEF DFS_COMPILER_3}
  {$DEFINE DFS_COMPILER_1_UP}
  {$DEFINE DFS_COMPILER_2_UP}
  {$DEFINE DFS_COMPILER_3_UP}
{$ENDIF}

{$IFDEF DFS_COMPILER_4}
  {$DEFINE DFS_COMPILER_1_UP}
  {$DEFINE DFS_COMPILER_2_UP}
  {$DEFINE DFS_COMPILER_3_UP}
  {$DEFINE DFS_COMPILER_4_UP}
{$ENDIF}

{$IFDEF DFS_COMPILER_5}
  {$DEFINE DFS_COMPILER_1_UP}
  {$DEFINE DFS_COMPILER_2_UP}
  {$DEFINE DFS_COMPILER_3_UP}
  {$DEFINE DFS_COMPILER_4_UP}
  {$DEFINE DFS_COMPILER_5_UP}
{$ENDIF}

{$IFDEF DFS_COMPILER_6}
  {$DEFINE DFS_COMPILER_1_UP}
  {$DEFINE DFS_COMPILER_2_UP}
  {$DEFINE DFS_COMPILER_3_UP}
  {$DEFINE DFS_COMPILER_4_UP}
  {$DEFINE DFS_COMPILER_5_UP}
  {$DEFINE DFS_COMPILER_6_UP}
{$ENDIF}

{$IFDEF DFS_COMPILER_2007}
  {$DEFINE DFS_COMPILER_1_UP}
  {$DEFINE DFS_COMPILER_2_UP}
  {$DEFINE DFS_COMPILER_3_UP}
  {$DEFINE DFS_COMPILER_4_UP}
  {$DEFINE DFS_COMPILER_5_UP}
  {$DEFINE DFS_COMPILER_6_UP}
  {$DEFINE DFS_COMPILER_2007_UP}
{$ENDIF}

{$IFDEF DFS_DELPHI_2}
  {$DEFINE DFS_DELPHI_2_UP}
{$ENDIF}

{$IFDEF DFS_DELPHI_3}
  {$DEFINE DFS_DELPHI_2_UP}
  {$DEFINE DFS_DELPHI_3_UP}
{$ENDIF}

{$IFDEF DFS_DELPHI_4}
  {$DEFINE DFS_DELPHI_2_UP}
  {$DEFINE DFS_DELPHI_3_UP}
  {$DEFINE DFS_DELPHI_4_UP}
{$ENDIF}

{$IFDEF DFS_DELPHI_5}
  {$DEFINE DFS_DELPHI_2_UP}
  {$DEFINE DFS_DELPHI_3_UP}
  {$DEFINE DFS_DELPHI_4_UP}
  {$DEFINE DFS_DELPHI_5_UP}
{$ENDIF}

{$IFDEF DFS_DELPHI_6}
  {$DEFINE DFS_DELPHI_2_UP}
  {$DEFINE DFS_DELPHI_3_UP}
  {$DEFINE DFS_DELPHI_4_UP}
  {$DEFINE DFS_DELPHI_5_UP}
  {$DEFINE DFS_DELPHI_6_UP}
{$ENDIF}

{$IFDEF DFS_DELPHI_7}
  {$DEFINE DFS_DELPHI_2_UP}
  {$DEFINE DFS_DELPHI_3_UP}
  {$DEFINE DFS_DELPHI_4_UP}
  {$DEFINE DFS_DELPHI_5_UP}
  {$DEFINE DFS_DELPHI_6_UP}
  {$DEFINE DFS_DELPHI_7_UP}
{$ENDIF}

{$IFDEF DFS_DELPHI_8}
  {$DEFINE DFS_DELPHI_4_UP}
  {$DEFINE DFS_DELPHI_5_UP}
  {$DEFINE DFS_DELPHI_6_UP}
  {$DEFINE DFS_DELPHI_7_UP}
  {$DEFINE DFS_DELPHI_8_UP}
{$ENDIF}

{$IFDEF DFS_DELPHI_2005}
  {$DEFINE DFS_DELPHI_4_UP}
  {$DEFINE DFS_DELPHI_5_UP}
  {$DEFINE DFS_DELPHI_6_UP}
  {$DEFINE DFS_DELPHI_7_UP}
  {$DEFINE DFS_DELPHI_8_UP}
  {$DEFINE DFS_DELPHI_2005_UP}
{$ENDIF}

{$IFDEF DFS_DELPHI_2006}
  {$DEFINE DFS_DELPHI_4_UP}
  {$DEFINE DFS_DELPHI_5_UP}
  {$DEFINE DFS_DELPHI_6_UP}
  {$DEFINE DFS_DELPHI_7_UP}
  {$DEFINE DFS_DELPHI_8_UP}
  {$DEFINE DFS_DELPHI_2005_UP}
  {$DEFINE DFS_DELPHI_2006_UP}
{$ENDIF}

{$IFDEF DFS_DELPHI_2007}
  {$DEFINE DFS_DELPHI_4_UP}
  {$DEFINE DFS_DELPHI_5_UP}
  {$DEFINE DFS_DELPHI_6_UP}
  {$DEFINE DFS_DELPHI_7_UP}
  {$DEFINE DFS_DELPHI_8_UP}
  {$DEFINE DFS_DELPHI_2005_UP}
  {$DEFINE DFS_DELPHI_2006_UP}
  {$DEFINE DFS_DELPHI_2007_UP}
{$ENDIF}

{$IFDEF DFS_COMPILER_3_UP}
  {$DEFINE DFS_NO_COM_CLEANUP}
{$ENDIF}

